package com.buobao.lambda;

import java.util.function.Function;

/**
 * function接口示例
 * 用于有一个输入且需要返回输出的情况
 */
public class FunctionSample {
    public static void main(String[] args) {
        Function<Integer,String> function = (a)->{
            StringBuilder result = new StringBuilder();
            for (int i=0;i<a;i++) {
                result.append("a");
            }
            return result.toString();
        };

        System.out.println(function.apply(5));
    }
}
